import 'package:flutter_html/flutter_html.dart';
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:magic_car/util/HttpHelper.dart';
import 'package:shared_preferences/shared_preferences.dart';
class AgreementPage extends StatefulWidget {
  AgreementPage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<AgreementPage> {
var content='';
Map acountinfo = new Map();
@override
  void initState() {
    super.initState();
   

    loaddata(); 
  }


  //加载数据
  loaddata() async {
    Map<String, String> map = new Map();
    
    HttpHelper.post(HttpHelper.API_Agreement, (data) async {
      print(data);
      if (data != null) {
        
        print(data);
        print(data["info"].length.toString());
        if (data["code"].toString() == "1") {
          setState(() {
            content=data['info']['inspector_agreement'];
          //  acountinfo = data["info"];
          });
          

        }
      }
    }, params: map);
  }
  Widget build(BuildContext context) {
    return new Scaffold(
       appBar: new AppBar(
        title: new Text('入驻协议',style: TextStyle(color:Colors.black),),
        backgroundColor: Colors.white,
        elevation: 0,
         iconTheme: IconThemeData(
            color: Colors.black, //修改颜色
          ),
        // backgroundColor: Color.fromRGBO(255, 204, 48, 1),
      ),
        body: new Container(
          child: new ListView(
          children: <Widget>[
            Html(
  data: content,
),
          ]
          )
          
        ));
  }
}
